def prune_transformer(model, amount=0.3):
            for name, module in model.named_modules():
                if isinstance(module, torch.nn.Linear):
                    prune.l1_unstructured(module, name='weight', amount=amount)
                    prune.remove(module, 'weight')
            return model

        # Efficient Multilingual NMT
        class LightTranslator(nn.Module):
            def __init__(self, vocab_size, d_model=512):
                super().__init__()
                self.encoder = TransformerEncoder(d_model)
                self.decoder = TransformerDecoder(d_model)

            def forward(self, src, tgt):
                memory = self.encoder(src)
                return self.decoder(tgt, memory)
Avatar of Ahmed Amine ALIANE

Ahmed Amine ALIANE

Algiers, Algeria

Research Engineer in NLP specializing in model efficiency and multilingual systems, with full-stack, Linux systems, and infrastructure expertise.

  • fingerprint About
  • menu_book Publications
  • architecture Projects
  • inventory_2 CV

#vocabulary pruning

Content tagged with "vocabulary pruning"

Efficient Multilingual Neural Machine Translation via Corpus-Driven Vocabulary Pruning: An English-Arabic Case Study
2026-08-05 Ahmed Amine Aliane, Nasredine Semmar, Hassina Aliane arXiv preprint
[NLP] [Machine Translation] [Vocabulary Pruning] [Model Compression] [Arabic]

A framework combining corpus-driven vocabulary pruning and targeted fine-tuning to compress multilingual NMT models by 60% without performance loss.

© 2026 Ahmed Amine Aliane.